from PyQt5 import QtWidgets
app=QtWidgets.QApplication([])
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
layout=QFormLayout()
a=QLineEdit()
a.setText('hasaki')
layout.addRow('hasaki',a)
l=QtWidgets.QWidget()
l.setLayout(layout)
l.show()
# 结果会显示一个hasaki后面跟着一个可编辑的单行框,里面显示的是hasaki